Noble Ape Philosophic - Contents - Introduction to ApeScript

File Format

The file format for the Noble Ape Simulation is text based and allows users to create their own Noble Ape Simulation environments. The following section explains the syntax of the Noble Ape Simulation's file format.

Comments

Comments allow users (or the Simulation) to add human read-able comments to the files which won't be read by the Simulation.

   /* This is a comment */

   /*
      This is also a comment
   */

Comments also allow users to remove sections of the file to test particular functionality or for temporary changes.

Objects and Variables

The Noble Ape file format is based on objects and variables. The central elements are three letters that identify both objects and variables. An object includes a number of variables. The example definition of object 'obj' and variable 'var', is as follows;

   obj{
      var = 123;
   };

Multiple values can be given for particular variables too. For example;

   rav = 123, 222, 111;

The Noble Ape Simulation supports two kinds of variables. One byte integers with values between 0 and 255 (inclusive), and two byte integers with values between 0 and 65535 (inclusive). Some variables will only accept one byte integers. In the file format variable definitions below, one_byte denotes a one byte value expected two_bytes denotes a two byte value expected.

Simulation Header

The Simulation Header identifies the Noble Ape Simulation and the Simulation version.
   sim{
      sig = 20033;
      ver = 687;
   };
Signature
   sig = 20033; /* two bytes */

As the Noble Ape file format is now accepted by two programs and possibly more in the future, the signature value identifies which program created the file and also, potentially, which programs can accept the file. The signature value for the Noble Ape Simulation is 20033.

Version

   ver = 687; /* two bytes */

This shows the version of the Noble Ape Simulation that saved the file. It is also a good test for compatibility. Currently the Noble Ape Simulation will only open files with version numbers less than or equal to the version of the Noble Ape Simulation.

Landscape

The landscape description contains all the environment related information.
   lnd{
      tim = 9;
      dat = 0, 0;
      gen = 56049, 59146;
   };
Time
   tim = 1205; /* two bytes : number of minutes */

The time shows the number of minutes since midnight.

Date

   dat = 216, 0; /* two bytes : number of days, number of centuries */

The date shows the number of days since the Simulation started running (in simulation time) followed by the number of centuries from when the simulation started running.

Generator

   gen = 23461,49283; /* two bytes : two seed numbers */

The generator numbers are the random seed when the landscape is created. They represent the specific landscape generated.

Being (aka Ape)

The being information represents a single cognitive entity in the Simulation (ie a Noble Ape).
   bng{
      loc = 16100, 32;
      fac = 49;
      spd = 0;
      nrg = 3847;
      idn = 18424;
      dob = 0;
      spk = 0;
      rnd = 26592, 20360;
      brn = 171, 0, 146, 86, 501, 73;
   };
Location
   loc = 2342, 3324; /* two bytes : x-location, y-location */

The location variables give the x and y axis co-ordinates of the being. The movement resolution is shown relative to the Simulation area in the following table.

Edge Width
Environment Size
Simulation Resolution
Ape Movement Resolution
Metric
12.8 km
50 metres
78 1/8 cm
Imperial
8 miles
54 2/3 yards
30 2/3 inches
Divisions

256
16384

Facing

   fac = 24; /* one byte */

The facing information describes the direction the ape is facing (0-63). The numbers rotate clockwise with 48 is north facing and 0 is east facing.

Speed

   spd = 10; /* one byte */

This number represents a unit speed per minute. There is no nice conversion for this number. The speed result is linear. Two relative extremes are shown here.

spd = 1;
   936 seconds (roughly 15 minutes) to travel 10 meters
   0.64 meters per minute

spd = 20;
   46.8 seconds to travel 10 meters
   12.8 meters per minute

Energy

   nrg = 2543; /* two bytes */

This is the being's current total energy. This amount should never fall below about 1000, and typically won't go above about 3840. The ape eats roughly three times per day. They can consume upwards of 2560 energy units in a single sitting.

Identification Number

   idn = 39858; /* two bytes */

The being's identification number can roughly be equated to ape genetics. If the number is even, the being is male.

Date Of Birth

   dob = 0; /* two bytes : year */

The being's date of birth relating to the Simulation's date value. Technically all beings starting the Simulation at initially will have a 'Date of Birth' of 0. This isn't ideal. But together with the state value(see below) this is new in-development technology with the Simulation.

Speaking

   spk = 0; /* two bytes */

The Noble Apes have a simple method of communication. You can write your own Noble Ape language through ApeScript, through the simple speak/listen protocol. 0 = saying nothing, any other number indicates some form of communication.

Random Seed

   rnd = 3452, 16786; /* two bytes : two seed numbers */

This is the random seed at the time the file is saved. The two numbers change pseudo-randomly through the Simulation per being.

Brain Values

   brn = 171, 0, 146, 86, 501, 73; /* two bytes */

The brain values are used by the cognitive simulation. The basic brain formula is;

   b(t+1) = a*l + b(t)*m + (b(t)-b(t-1))*n;

The first three brain variables are l, m, n for awake, then l, m, n for asleep.

Partial Files

The file format supports partial files. If the user wants to change just the landscape characteristics or the time etc, they can create files that only change those variables.
Noble Ape Philosophic - Contents - Introduction to ApeScript